//
//  UIView+Nib.m
//  HDCommon
//
//  Created by zhd on 2023/6/18.
//

#import "UIView+Nib.h"

@implementation UIView (Nib)
+(instancetype)nibView{
    NSString * nibName = NSStringFromClass(self);
    
    
    UIView * view = [[UINib nibWithNibName:nibName bundle:nil] instantiateWithOwner:nil options:nil].firstObject;
    view.autoresizingMask = UIViewAutoresizingNone; // 这个设置了之后就不会随着父控件的frame改变而改变；
    
    
    
    //    return [[[NSBundle mainBundle] loadNibNamed:nibName owner:self options:nil] lastObject];
    return view;
    
    
}
+(UINib *)nibClass{
    NSString * nibName = NSStringFromClass(self);
    //     NSArray *nibArrays = [ instantiateWithOwner:nil options:nil];
    return [UINib nibWithNibName:nibName bundle:nil];
}
@end
